<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateLawyerCasesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('lawyer_cases', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->unique()->default('')->comment('案件名称');
            $table->string('author')->index()->default('')->comment('发布者');
            $table->string('cover')->default('')->comment('封面');
            $table->string('description')->default('')->comment('描述');
            $table->text('essay')->comment('内容');
            $table->timestamp('crime_time')->comment('案发时间');
            $table->integer('views')->default('0')->comment('查看次数');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('lawyer_cases');
    }
}
